<html>
  <head>
    <title tal:content="title">
    </title>
	<link rel="stylesheet" href="../css/stylesheet.css" type="text/css" />
	<script src="http://code.jquery.com/jquery-latest.js"></script>
        <script>$(".toggle").slideUp();
$(".trigger").click(function(){
    $(this).next(".toggle").slideToggle("slow");
  });</script>
  </head>
<?php
require_once '../conf/DbConnector.php';

$db=mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME)
		or die('<p><font color=red>Fehler bei der Datenbankverbindung: '.
		mysqli_connect_errno().': '.mysqli_connect_error().'</p>');

$sql_name = "SELECT Book.Book_Name, Series.Ser_ID, Series.Ser_Name
FROM Author, Book, Series, Book_has_Lang
WHERE Book.Book_ID = " . $_GET['id'] . " 
AND Book.Series_Ser_ID = Series.Ser_ID
AND Book.Author_Auth_ID = Author.Auth_ID
GROUP BY Book.Book_ID";

$result_name = mysqli_query($db, $sql_name);

$zeile_name = mysqli_fetch_array($result_name);

?>

  <body>
    <div id="kopf">
	<div id="kopf1">
		hallo Mitte
		<div id="login">
			rechts login
		</div>
		<div id="logo">
			Logo
		</div>
	</div>
	<div id="pfad">
            <p><a href="../">Index</a> > <a href="./">Series</a> > <a href="Series.php?id=<?php echo $zeile_name['Ser_ID']; ?>"><?php echo $zeile_name['Ser_Name']; ?></a></p>
	</div>
<?php

$sql="SELECT Book.Book_Name, Book.Book_ID,Book.Book_Vol, Book.Book_Cover, Series.Ser_ID,Series.Ser_Name, Author.Auth_Name
FROM Author, Book, Series, Book_has_Lang
WHERE Book.Book_ID = " . $_GET['id'] . " 
AND Book.Series_Ser_ID = Series.Ser_ID
AND Book.Author_Auth_ID = Author.Auth_ID
GROUP BY Book.Book_ID";

$result = mysqli_query($db, $sql);

$zeile=mysqli_fetch_array($result);


?>
</div>
    <div class="book">
        
        <div class="cover">
    <svg xmlns="http://www.w3.org/2000/svg" height="100%" 
         preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 200 400" 
         width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
      <image height="400" width="200" xlink:href="../images/books/<?php echo $zeile['Ser_ID']; ?>/<?php echo $zeile['Book_ID']; ?>/cover.jpg"></image>
    </svg>
  </div>
        
<div class="BTEXT">
<?php if (isset($zeile['Ser_Name'])) { ?>
        
        <p><b>Series:</b> <?php echo $zeile['Ser_Name']; ?></p>
        
<?php } ?>
        
<?php if (isset($zeile['Book_Name'])) { ?>
        
        <p><b>Titel:</b> <?php echo $zeile['Book_Name']; ?></p>
        
<?php } ?>
        
<?php if (isset($zeile['Vook_Vol'])) { ?>
        
        <p><b>Volume:</b> <?php echo $zeile['Book_Vol']; ?></p>
        
<?php } ?>
        
<?php if (isset($zeile['Auth_Name'])) { ?>
        
        <p><b>Author:</b> <?php echo $zeile['Auth_Name']; ?></p>
        
<?php } ?>
</div>
        
        
<?php 

$sql2="SELECT DL_Link, Extentions.Ext_Name, Creator.Creator_Name 
FROM LNDL, Extentions, Creator
WHERE LNDL.Book_Book_ID = " . $_GET['id'] . "
AND Extentions.Ext_ID = LNDL.Extentions_Ext_ID
AND Creator.Creator_ID = LNDL.Creator_Creator_ID
ORDER BY LNDL.Extentions_Ext_ID";

$result2 = mysqli_query($db, $sql2);
?>
<div class="BTEXT"> 
<?php
while ($zeile2=mysqli_fetch_array($result2)){
?>
   
        <p><a href="<?php echo $zeile2['DL_Link']; ?>"><?php echo $zeile2['Ext_Name']; ?></a> BY <?php echo $zeile2['Creator_Name']; ?></p>
        
<?php

}

?>
        
</div>    
</div>
  </body>
</html>

<?php

mysqli_close($db);

?>